#include<stdio.h>
int main()
{
    int i;
    char ch,bb[100]={};

    for(i=0;i<=100;i++)
         {
         scanf("%c",&bb[i]);
         if(bb[i]=='#')
         {
          break;
         }
         if(bb[i]>='A'&&bb[i]<='Z')
            {
            bb[i]+=32;
            }
         else if(bb[i]>='a'&&bb[i]<='z')
            {
            bb[i]-=32;
            }
    }
    for(int j=0;j<i;j++)
    {
           printf("%c",bb[j]);
    }
    return 0;
}
